require("lspconfig").zls.setup({
    capabilities = require("cmp_nvim_lsp").default_capabilities(),
})

vim.api.nvim_create_autocmd("LspAttach", {
    group = vim.api.nvim_create_augroup("lsp_augroup", { clear = true }),
    callback = function()
        vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = true })
        vim.keymap.set("n", "grt", vim.lsp.buf.type_definition, { buffer = true })
        vim.keymap.set("n", "grn", vim.lsp.buf.rename, { buffer = true })
        vim.keymap.set({ "n", "x" }, "gra", vim.lsp.buf.code_action, { buffer = true })
        vim.keymap.set("n", "grr", vim.lsp.buf.references, { buffer = true })
        vim.keymap.set("n", "gri", vim.lsp.buf.implementation, { buffer = true })
        vim.keymap.set("n", "gO", vim.lsp.buf.document_symbol, { buffer = true })
        vim.keymap.set("i", "<C-s>", vim.lsp.buf.signature_help, { buffer = true })
    end,
})
